Page({
  data: {
   
  carsendid:'' ,

  },
  onLoad(query) {
   
   this.setData({
   carsendid:query.id,


   });
    
    var that=this;
    dd.httpRequest({

        
          //提交工号和授权码，如果授权码和工号对上了就返回姓名，然后保存工号到缓存
          //url: 'https://oapi.dingtalk.com/user/getuserinfo?access_token=' + access_token + '&code=' + code,
      
          url:'http://ding.tida-lighting.com/api/Approve/GetCarList',
          success: function (res) {
         
         // console.log(that.data.staffid);
          that.setData({
             lst:res.data,
            
          });

          console.log(res.data);
         },
        fail: (err) => {
           //dd.alert({content: JSON.stringify(err)})
           console.log(err);
        }

     });//发起结束
  

  },
  arra:function(e)
  {


    var  id =e.target.dataset.value;

    console.log(e);
    
    var  flowid=this.data.carsendid;
   
   console.log("Id: "+id +" flowId: "+flowid);


   dd.httpRequest({

        
          url:'http://ding.tida-lighting.com/api/leave/arra',
          dataType:'json',
          method:'POST',
          data:{
               flowId:flowid,
               carId:id,

         

          },
          success: function (res) {

            
           dd.showToast({
    title: '您好',
     content:res.data.msg,
     success: () => {
       dd.navigateBack({
delta:2 //返回上一级页面
});
    
          
         }});
          }, fail: (err) => {
           //dd.alert({content: JSON.stringify(err)})
           console.log(err);
        }
          
          });

  },

  

});
